package com.culturalCenter.dataCenter.mapper.user;

import com.culturalCenter.dataCenter.entity.user.UserLocationCount;
import com.culturalCenter.dataCenter.mapper.base.BaseMapper;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface UserLocationCountMapper extends BaseMapper<UserLocationCount> {

    /**
     * 通过用户id查询
     *
     * @param userId 用户id
     *
     * @return
     */
    List<UserLocationCount> queryByUserId(@Param("userId") String userId);

    /**
     * 批量插入数据
     *
     * @param userLocationCountList
     */
    void insertBatch(List<UserLocationCount> userLocationCountList);

    /**
     * @Description 清空表
     * @Param []
     * @Return void
     */
    @Delete("TRUNCATE cdc_user_location_count")
    void deleteAll();

}
